\doxysection{Splay\+Tree$<$ Comparable $>$ Class Template Reference}
\label{class_splay_tree}\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}


A splaytree.  




{\ttfamily \#include $<$Binary\+Tree.\+h$>$}



Inheritance diagram for Splay\+Tree$<$ Comparable $>$\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=550pt]{class_splay_tree__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for Splay\+Tree$<$ Comparable $>$\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=550pt]{class_splay_tree__coll__graph}
\end{center}
\end{figure}
\doxysubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ Splay\+Node}
\begin{DoxyCompactList}\small\item\em Node for splay tree. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual \textbf{ $\sim$\+Splay\+Tree} ()
\item 
virtual void \textbf{ insert} (const Comparable \&x)
\item 
virtual void \textbf{ insert} (Comparable \&\&x)
\item 
virtual void \textbf{ remove} (const Comparable \&x)
\item 
virtual void \textbf{ remove} (Comparable \&\&x)
\item 
const Comparable \& \textbf{ find\+Min} () const
\item 
const Comparable \& \textbf{ find\+Max} () const
\item 
void \textbf{ print\+Tree} (ostream \&out=cout) const
\item 
void \textbf{ make\+Empty} ()
\end{DoxyCompactItemize}
\doxysubsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
void \textbf{ rotate\+With\+Left\+Child} (\textbf{ Splay\+Node} $\ast$\&k2)
\item 
void \textbf{ rotate\+With\+Right\+Child} (\textbf{ Splay\+Node} $\ast$\&k1)
\item 
void \textbf{ splay} (const Comparable \&x, \textbf{ Splay\+Node} $\ast$\&t)
\end{DoxyCompactItemize}
\doxysubsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\textbf{ Splay\+Node} $\ast$ \textbf{ root} = nullptr
\item 
\textbf{ Splay\+Node} $\ast$ \textbf{ null\+Node} = nullptr
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Comparable$>$\newline
class Splay\+Tree$<$ Comparable $>$}

A splaytree. 


\begin{DoxyTemplParams}{Template Parameters}
{\em Comparable} & \\
\hline
\end{DoxyTemplParams}


\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\label{class_splay_tree_a965214e51607b6bbd9c72fb690efb388}} 
\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}!````~SplayTree@{$\sim$SplayTree}}
\index{````~SplayTree@{$\sim$SplayTree}!SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}
\doxysubsubsection{$\sim$SplayTree()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual \textbf{ Splay\+Tree}$<$ Comparable $>$\+::$\sim$\textbf{ Splay\+Tree} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



\doxysubsection{Member Function Documentation}
\mbox{\label{class_bst_tree_a57eb8235cc129e90871524a5c60bc814}} 
\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}!findMax@{findMax}}
\index{findMax@{findMax}!SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}
\doxysubsubsection{findMax()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
const Comparable\& \textbf{ Bst\+Tree}$<$ Comparable $>$\+::find\+Max (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inherited]}}

Find the largest item in the tree. Throw Underflow\+Exception if empty. \mbox{\label{class_bst_tree_a4106cfce2da1be70b4b22f1c41e5d406}} 
\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}!findMin@{findMin}}
\index{findMin@{findMin}!SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}
\doxysubsubsection{findMin()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
const Comparable\& \textbf{ Bst\+Tree}$<$ Comparable $>$\+::find\+Min (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inherited]}}

Find the smallest item in the tree. \mbox{\label{class_splay_tree_adde9d24f5ea5c441e0cee83cce7afedd}} 
\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}!insert@{insert}}
\index{insert@{insert}!SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}
\doxysubsubsection{insert()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual void \textbf{ Splay\+Tree}$<$ Comparable $>$\+::insert (\begin{DoxyParamCaption}\item[{Comparable \&\&}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Reimplemented from \textbf{ Bst\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_bst_tree_ad1fd360ecaf13dd46d1b3e4030647af1}.

\mbox{\label{class_splay_tree_a8aee728cd2536dc8306129fa64c1f694}} 
\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}!insert@{insert}}
\index{insert@{insert}!SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}
\doxysubsubsection{insert()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual void \textbf{ Splay\+Tree}$<$ Comparable $>$\+::insert (\begin{DoxyParamCaption}\item[{const Comparable \&}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

Insert x into the tree; duplicates are ignored. 

Reimplemented from \textbf{ Bst\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_bst_tree_a8c92bedb44279045795259b36031c725}.

\mbox{\label{class_binary_tree_af1cb2a82a7837713d1d0e71cd90a76a0}} 
\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}!makeEmpty@{makeEmpty}}
\index{makeEmpty@{makeEmpty}!SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}
\doxysubsubsection{makeEmpty()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
void \textbf{ Binary\+Tree}$<$ Comparable $>$\+::make\+Empty (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inherited]}}

Make the tree logically empty. \mbox{\label{class_binary_tree_a2ed034626b76cf27efe77bce17604bc4}} 
\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}!printTree@{printTree}}
\index{printTree@{printTree}!SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}
\doxysubsubsection{printTree()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
void \textbf{ Binary\+Tree}$<$ Comparable $>$\+::print\+Tree (\begin{DoxyParamCaption}\item[{ostream \&}]{out = {\ttfamily cout} }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inherited]}}

Print the tree contents. \mbox{\label{class_splay_tree_af020a5b6cf5934071739aad949802edd}} 
\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}!remove@{remove}}
\index{remove@{remove}!SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}
\doxysubsubsection{remove()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual void \textbf{ Splay\+Tree}$<$ Comparable $>$\+::remove (\begin{DoxyParamCaption}\item[{Comparable \&\&}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Reimplemented from \textbf{ Bst\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_bst_tree_a0251edb51327b40d42e576c885c24334}.

\mbox{\label{class_splay_tree_a4dfaad055380b8384d9365823e224bf0}} 
\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}!remove@{remove}}
\index{remove@{remove}!SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}
\doxysubsubsection{remove()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual void \textbf{ Splay\+Tree}$<$ Comparable $>$\+::remove (\begin{DoxyParamCaption}\item[{const Comparable \&}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

Remove x from the tree. Nothing is done if x is not found. 

Reimplemented from \textbf{ Bst\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_bst_tree_a7cb0b1bd945708ccf9e4af1905b6ac95}.

\mbox{\label{class_splay_tree_a767e803b465ff47e8aa05d2de714665c}} 
\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}!rotateWithLeftChild@{rotateWithLeftChild}}
\index{rotateWithLeftChild@{rotateWithLeftChild}!SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}
\doxysubsubsection{rotateWithLeftChild()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
void \textbf{ Splay\+Tree}$<$ Comparable $>$\+::rotate\+With\+Left\+Child (\begin{DoxyParamCaption}\item[{\textbf{ Splay\+Node} $\ast$\&}]{k2 }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}

\mbox{\label{class_splay_tree_a37ed24f4f317554fe768c14f02b0cba5}} 
\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}!rotateWithRightChild@{rotateWithRightChild}}
\index{rotateWithRightChild@{rotateWithRightChild}!SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}
\doxysubsubsection{rotateWithRightChild()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
void \textbf{ Splay\+Tree}$<$ Comparable $>$\+::rotate\+With\+Right\+Child (\begin{DoxyParamCaption}\item[{\textbf{ Splay\+Node} $\ast$\&}]{k1 }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}

\mbox{\label{class_splay_tree_aaa7cb74a7e489100cc268d387bb4f455}} 
\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}!splay@{splay}}
\index{splay@{splay}!SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}
\doxysubsubsection{splay()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
void \textbf{ Splay\+Tree}$<$ Comparable $>$\+::splay (\begin{DoxyParamCaption}\item[{const Comparable \&}]{x,  }\item[{\textbf{ Splay\+Node} $\ast$\&}]{t }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}

Internal method to perform a top-\/down splay. The last accessed node becomes the new root. This method may be overridden to use a different splaying algorithm, however, the splay tree code depends on the accessed item going to the root. x is the target item to splay around. t is the root of the subtree to splay. 

\doxysubsection{Member Data Documentation}
\mbox{\label{class_splay_tree_a9708675102139937fbbe4cd3ab80304c}} 
\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}!nullNode@{nullNode}}
\index{nullNode@{nullNode}!SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}
\doxysubsubsection{nullNode}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
\textbf{ Splay\+Node}$\ast$ \textbf{ Splay\+Tree}$<$ Comparable $>$\+::null\+Node = nullptr\hspace{0.3cm}{\ttfamily [private]}}

\mbox{\label{class_splay_tree_acfa34a6b533cbbdc2a70dad080e86a1d}} 
\index{SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}!root@{root}}
\index{root@{root}!SplayTree$<$ Comparable $>$@{SplayTree$<$ Comparable $>$}}
\doxysubsubsection{root}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
\textbf{ Splay\+Node}$\ast$ \textbf{ Splay\+Tree}$<$ Comparable $>$\+::root = nullptr\hspace{0.3cm}{\ttfamily [private]}}



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\textbf{ Binary\+Tree.\+h}\end{DoxyCompactItemize}
